package com.hzdp.netty.bio.pool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class TimeServerHandlerExecutePool {

	private ExecutorService executorService;

	public TimeServerHandlerExecutePool(int maxPoolSize, int queneSize) {
		executorService = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), maxPoolSize, 120l, TimeUnit.SECONDS,
				new ArrayBlockingQueue<Runnable>(queneSize));
	}

	public void execute(Runnable task) {
		executorService.execute(task);
	}
}
